//
//  YKVerticalButton.m
//  百思不得姐
//
//  Created by Eric.Wu on 16/2/28.
//  Copyright © 2016年 Eric.Wu. All rights reserved.
//

#import "YKVerticalButton.h"

@implementation YKVerticalButton

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
    }
    return self;
}

- (void)awakeFromNib
{
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
//    self.imageView.layer.cornerRadius = 5;
//    self.layer.masksToBounds
}


- (void)layoutSubviews
{
    [super layoutSubviews];
    self.imageView.x = 0;
    self.imageView.y = 0;
    self.imageView.width = self.width;

    self.imageView.height = self.imageView.width;
    self.titleLabel.x = 0;
    self.titleLabel.width = self.width;
    self.titleLabel.height = self.height - self.imageView.height;
    self.titleLabel.y = self.height - self.titleLabel.height;
}
@end
